//
//  ChoicenessDetailsCell.m
//  PetTown
//
//  Created by lanou3g on 15/5/28.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "ChoicenessDetailsCell.h"

@implementation ChoicenessDetailsCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self yy_setupSubviews];
    }
    return self;
}
- (void)yy_setupSubviews{
    //评论者头像
    self.pl_imageView = [[UIImageView alloc] init];
    _pl_imageView.frame = CGRectMake(10, 10, 50, 50);
    [self.contentView addSubview:_pl_imageView];
    //评论者昵称(nickname)及宠物昵称(disname)
    self.pl_name = [[UILabel alloc] initWithFrame:CGRectMake(70, 0, 200, 30)];
    [self.contentView addSubview:_pl_name];
    //发布时间
    self.pl_time = [[UILabel alloc] initWithFrame:CGRectMake([[UIScreen mainScreen] bounds].size.width-80, 0, 80, 30)];
    [self.contentView addSubview:_pl_time];
    //评论内容
    self.pl_content = [[UILabel alloc] initWithFrame:CGRectMake(70, 30, [[UIScreen mainScreen] bounds].size.width-80, 70)];
    _pl_content.numberOfLines = 0;
    _pl_content.font = [UIFont systemFontOfSize:14];
    [self.contentView addSubview:_pl_content];
    //楼层数
    self.pl_lou = [[UILabel alloc] initWithFrame:CGRectMake(10, 70, 50, 30)];
    _pl_lou.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:_pl_lou];


    

}
- (void)setReviewer:(Reviewer *)reviewer{
    UIImage * imm = [UIImage imageNamed:@"place.jpg"];
    [_pl_imageView sd_setImageWithURL:[NSURL URLWithString:reviewer.avatar] placeholderImage:imm];
    _pl_name.text = [NSString stringWithFormat:@"{%@}的'%@'",reviewer.nickname,reviewer.disname];
    _pl_time.text = reviewer.time;
    _pl_content.text = reviewer.content;

    _pl_lou.text = [NSString stringWithFormat:@"%@F",reviewer.lou];
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
